- type = BankStatementItem === item ? 'bank_statement_item' : 'journal_entry_item'
- letter = type =~ /bank_statement_item/ ? item.letter : item.bank_statement_letter
- classes = [:'reconciliation-item']
- classes << :lettered if letter
%div{ class: classes, data: { id: item.id, type: type } }
  %a#delete{ href: "#" }
    - unless type == 'journal_entry_item'
      %i
  .title
    %i#type-icon{class: type.dasherize}= # type.humanize
    .name= item.name
  .amounts
    .debit= item.debit
    .credit= item.credit
  .details
    .letter= letter
    - if letter
      = link_to backend_bank_reconciliation_letter_path(id: item.bank_statement.id, letter: letter), method: :delete, remote: true do
        %i
        %span= :clear.tl
